package com.bum.api.processor.quiz.html.bo;

import org.apache.commons.lang.StringUtils;

import com.bum.api.core.exp.om.Metas;
import com.bum.api.core.exp.om.Params;
import com.bum.api.core.html.HtmlModel;
import com.bum.api.core.html.HtmlRender;

public class QuizHtmlBO {
	HtmlRender	htmlRender;

	public String view(String path, Params params, Metas metas) {
		HtmlModel model = HtmlModel.get(metas);
		
		if (StringUtils.isBlank(path)) {
			return htmlRender.render("quiz/quiz-home", model);
		}
		
		return htmlRender.render("quiz/" + path, model);
	}
	
	public String quiz(String path, Params params, Metas metas) {
		HtmlModel model = HtmlModel.get(metas);
		return htmlRender.render("quiz/" + path, model);
	}

	public void setHtmlRender(HtmlRender htmlRender) {
		this.htmlRender = htmlRender;
	}
}
